# 6、编写程序，
# 生成一个包含 20 个随机整数的列表，
# 然后对其中偶数下标的元素进行降序排列，
# 奇数下标的元素不变。
import random
numlist = []
i = 0
while i < 20:
    num = random.randint(1,1000)
    if num not in numlist:
        numlist.append(num)
        i += 1
print(numlist)
oulist = numlist[::2]
oulist.sort(reverse=True)

for i in range(20):
    if i % 2 == 0:
        numlist[i] = oulist[int(i /2)]

print(numlist)